<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <button>按钮</button>

  <p>hello world</p>

  <input type="text">

  <script src="./js/jquery-3.6.0.js"></script>

  <script>
    $('button').on('click', function () {
      console.log('button');
    })

    $('p').on('click', function () {
      console.log('p');
    })

    $('p').on('mouseenter', function () {
      console.log('12345');
    })

    $('input').on('keyup', function (e) {
      if (e.keyCode === 13) {
        // 触发单击事件
        // $('元素').trigger('事件名');
        $('p').trigger('mouseenter');
      }
    })
  </script>
</body>

</html>